<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function index() {
            //获取属性
            // var a = document.getElementById('baidu');
            // console.log(a.href);
            // console.log(a.getAttribute("href"));


            //设置属性的值
            // a.href ='https://weibo.com/newlogin?tabtype=weibo&gid=102803&openLoginLayer=0&url'
            // a.target = "_self"
            // a.setAttribute('href','https://www.qq.com')
            // a.setAttribute("target","_self")
                


            //通过点击按钮来选择性别女
            var a =document.getElementById('unmale');   
            a.checked = "true";
            
          

        }
    </script>
</head>

<body>
    <button onclick="index();">我是一个按钮</button>
    <hr>
    <a href="https://www.baidu.com/?tn=94819464_hao_pg" id="baidu" target='_blank'>这是一个超链接</a><br>
    性别:<br><input type="checkbox" value="man" id="male"  >男
            <input type="checkbox" value="unman" id="unmale" >女

</body>

</html>